UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TQVUcI/DZsk3PeVB3tbbNV0PwZ3LS9WFjAwxDFc8Yrs='
WHERE
key_id = '76a06334b3eda2b5c61e3647013b6b2dfc0d76f04085589b1116508be7b682b8'
AND (
token = 'TQVUcI/DZsk3PeVB3tbbNV0PwZ3LS9WFjAwxDFc8Yrs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)