UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R57bJn/XWnWjHbiOK/JqMdO75IN47gIatpMAri5pyDg='
WHERE
key_id = '2a51a3cf3e0a525784d049c2000194d711d489aa2e6a2e73f3105967bae6fad1'
AND (
token = 'R57bJn/XWnWjHbiOK/JqMdO75IN47gIatpMAri5pyDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)