UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1c0cS3FVBrJmV/KHvc4s59tw8vClRAeuxMoviWZ73Jk='
WHERE
key_id = '4a6443d667333f8b5e39210be930894ecb85f4a8bb1eb819f9ce445dd5c9da87'
AND (
token = '1c0cS3FVBrJmV/KHvc4s59tw8vClRAeuxMoviWZ73Jk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)