UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YwUBu3cq3m1bsQidRDz6M2cJaZLisvbTwh1soee8mS0='
WHERE
key_id = '98528e95db1de399be0ff023287e9abb933e46f56b4cf344705aacf4e29fd0e7'
AND (
token = 'YwUBu3cq3m1bsQidRDz6M2cJaZLisvbTwh1soee8mS0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)