UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0fCKO0DFtradp7DTaXTI2q2hGXn5hggTxRlSLgw4mAs='
WHERE
key_id = '974221fe3e5ac9ff69921245d58fb87f326cf1735138fa7f390dc9b76604be74'
AND (
token = '0fCKO0DFtradp7DTaXTI2q2hGXn5hggTxRlSLgw4mAs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)