UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MhQiltc68AwpLSaGp/PWfnnqD7MKq8gb1RjVEJLeEr0='
WHERE
key_id = '065a7c1b010042b5bbc0dc0bd6044940aadaba2b25b212fd1eed12111866b524'
AND (
token = 'MhQiltc68AwpLSaGp/PWfnnqD7MKq8gb1RjVEJLeEr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)