UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '71O74AzNL+A2nST2uYkhgEzPpYtuklHjHIArkpSRWEc='
WHERE
key_id = 'f3aabd11929daf2636f6109391e4a8b9e014be9cc7df1d603ad65760a7ea5d50'
AND (
token = '71O74AzNL+A2nST2uYkhgEzPpYtuklHjHIArkpSRWEc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)