UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nNBVTYK9kLP3z7cxjm9hLSZZAirtNxdymsFBtjp75mA='
WHERE
key_id = 'cf86b982f4ac2557aad7d609fab7b6174a7d709a898a062abc743b4a2be11c25'
AND (
token = 'nNBVTYK9kLP3z7cxjm9hLSZZAirtNxdymsFBtjp75mA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)