UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NIom/O0ybc9bn6Dlo7YlQ8XPZYrU+SXcXsCAWCyXsTY='
WHERE
key_id = 'a096ec7ee45025230dc9c703d02b585fae1df768ba3b39329bd8080b976f5814'
AND (
token = 'NIom/O0ybc9bn6Dlo7YlQ8XPZYrU+SXcXsCAWCyXsTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)