UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G5H4bcjanORnXTiRuAQc5LCmDa2p8S4vmkQ5bfCB5vA='
WHERE
key_id = 'ede83688f89b086585d0c5e46fb3c90b41bfed682b4086b9aeb59bdd7e55e91c'
AND (
token = 'G5H4bcjanORnXTiRuAQc5LCmDa2p8S4vmkQ5bfCB5vA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)