UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6iQLO2pnS3K+4UQeShKLO8kLrhHL7jET4w9yrMIyyG4='
WHERE
key_id = '024eaa42947510a55f2d771ce91172ec68fc33f1e4ab13b24a714244d4c3bd06'
AND (
token = '6iQLO2pnS3K+4UQeShKLO8kLrhHL7jET4w9yrMIyyG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)