UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lIOYxaxf/aWh6MMwTFP7rjShJUfi0bIaSywF2dW49FE='
WHERE
key_id = 'c7f5c0f20c0d1177894da6ee02dd22ceb93fae2fe2c7329f8ac6121b2c168774'
AND (
token = 'lIOYxaxf/aWh6MMwTFP7rjShJUfi0bIaSywF2dW49FE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)