UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hl7ZWJtK7NvEYqcinbZlNh4Dj6WIB+S7rwiaOYV2jEM='
WHERE
key_id = '1e8851959294b70ed77be06ff71cf31578e84b5c2c4ac5eb887af9eeb55ad7b6'
AND (
token = 'Hl7ZWJtK7NvEYqcinbZlNh4Dj6WIB+S7rwiaOYV2jEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)