UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0et+YA4OTrb7+3iQjjPqaZGAITR7eWQQYTkE9NFUXo0='
WHERE
key_id = 'e39108c6c6ccc4fb3ec09bb6ec2e86e637a5d21627febf8aab135d88aa81c80a'
AND (
token = '0et+YA4OTrb7+3iQjjPqaZGAITR7eWQQYTkE9NFUXo0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)