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