UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MjItPZTyEgcWzTqCSbX8NihuNupLS6RSAiLLMHy9Eys='
WHERE
key_id = '3e963cd749803d36cf853c07a4fcba58220ed30e7f304de16219ad0561bf9af0'
AND (
token = 'MjItPZTyEgcWzTqCSbX8NihuNupLS6RSAiLLMHy9Eys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)