UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '88cHcX+Ya3liKdNzaxx3KmX/XG+cyzRm14vtuDPjsRQ='
WHERE
key_id = '3d478fa53ddc8a47355aa2808169d05694dacb4b273a66544fe5da1851f5dbbe'
AND (
token = '88cHcX+Ya3liKdNzaxx3KmX/XG+cyzRm14vtuDPjsRQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)