UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mlAiH+SkTeir5d8F4IFwrjBwWU7P3Lve+0LaqUJNJvY='
WHERE
key_id = '71486ce23a89e75e14f8c0b25fbbf9035c60247dec6f915a9701f9ae1e19ae57'
AND (
token = 'mlAiH+SkTeir5d8F4IFwrjBwWU7P3Lve+0LaqUJNJvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)