UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fxQ9aMNnZgbtI48AzWl5VVDN8FM863I/Ztol16Ph868='
WHERE
key_id = 'be8a81106001b548ddeb0ba1abc1d002ed0b35898b52e71305c427eff2cc471a'
AND (
token = 'fxQ9aMNnZgbtI48AzWl5VVDN8FM863I/Ztol16Ph868='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)