UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7z/3wfkh1U8PILVj4vsfHD64dtkd00DUFxgZv1HQ+k0='
WHERE
key_id = 'c0eaf58d6a4d000a78ea2dfde52aaa821040a1f7ae0a37e8f49b6016bf4ce0e0'
AND (
token = '7z/3wfkh1U8PILVj4vsfHD64dtkd00DUFxgZv1HQ+k0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)