UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jOADTmpVCWzgg3ZxnmXwbM2Un9dqfAG71ZN/CEuiz2g='
WHERE
key_id = '277eeb438188c23c73a729255b50efa14b75ab3eee4f5d2f4e1e68ef965f5104'
AND (
token = 'jOADTmpVCWzgg3ZxnmXwbM2Un9dqfAG71ZN/CEuiz2g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)