UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dVjf2iYC7hNvpEhhrmFQIwTB4iabDzyOZ5Dj/gtClE0='
WHERE
key_id = '4d1084120cd3b7a59b8cf782e8f1a9747a63a99c35f4697c94c05057334d0c52'
AND (
token = 'dVjf2iYC7hNvpEhhrmFQIwTB4iabDzyOZ5Dj/gtClE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)