UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Reavkl2p/XowEIF+zJHfI8gBcc+8GOgUM23ymA6GS8='
WHERE
key_id = '4b499d3840d4c9d039634512b1e2c6d411a43315c69c3b7f92d0d850dd83523a'
AND (
token = '5Reavkl2p/XowEIF+zJHfI8gBcc+8GOgUM23ymA6GS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)