UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HQ0cShSWl/7LicGrythZgMyLO3BFqeCDOOXbt7Tq2kM='
WHERE
key_id = '1fdde21fb4377b1de183c06c478e86eeb5fc32dad554be3db330fd4c5350d8a8'
AND (
token = 'HQ0cShSWl/7LicGrythZgMyLO3BFqeCDOOXbt7Tq2kM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)