UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pi0d2IE4JGNl74Upf5cScFWvAukolvW8uUfvRNxSc4U='
WHERE
key_id = '7ee6bea5aa0eef0570fc41cfe219cf7189da48ee9d95c2092a89b8aca918a3ec'
AND (
token = 'pi0d2IE4JGNl74Upf5cScFWvAukolvW8uUfvRNxSc4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)