UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ANwFXgpe/Dk90mgGUHR6RD9xKH7p3Ci8OiPrJRIY1JI='
WHERE
key_id = '99cb82d5dafc41c932be6f034ebff9923de384fb20dc38b591c0e811382acef4'
AND (
token = 'ANwFXgpe/Dk90mgGUHR6RD9xKH7p3Ci8OiPrJRIY1JI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)