UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iEtNTyysCFgYuYooqQvWKPouW5bBps074sAaJiIr0dA='
WHERE
key_id = '6dd203cc586908cd0bbc4abde370fa21cf7ad9fa228436dfca9addac81293183'
AND (
token = 'iEtNTyysCFgYuYooqQvWKPouW5bBps074sAaJiIr0dA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)