UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OQgIYTfvuK8s7GH98gDfF1MAUE9AWnWl/BjsKac/uu4='
WHERE
key_id = 'dc6730bedbc4bb699bcba641602f2d8331b8e6cbabca8b217499076e24c0ecc7'
AND (
token = 'OQgIYTfvuK8s7GH98gDfF1MAUE9AWnWl/BjsKac/uu4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)