UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BO+l22+uDM6+QKiimDcfln3la0aWaQaln6nwolVYCk4='
WHERE
key_id = 'f1a0c339711141b52a326222ae2e6f171c87f24ee573aa18069351110e1fab61'
AND (
token = 'BO+l22+uDM6+QKiimDcfln3la0aWaQaln6nwolVYCk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)