UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5L/406xfOQ1eoVQZTlukd7uP0mTacwewkiIJ8Pf/nls='
WHERE
key_id = 'e7d20b65d431bdf52b18f65ad4879567c1c55a2f398508b002157a0e1d8cdfd6'
AND (
token = '5L/406xfOQ1eoVQZTlukd7uP0mTacwewkiIJ8Pf/nls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)