UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HRl34bM/mxO0gt19jG2x+uBnpbIJnQ9j/xYbj60NJ8E='
WHERE
key_id = 'd9cac6e173ee2b9115d4e657a8fc895b27780f69f4848ad15da7a7788ea6dd0b'
AND (
token = 'HRl34bM/mxO0gt19jG2x+uBnpbIJnQ9j/xYbj60NJ8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)