UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p09doBOqmRuUN044iNjopzG1F58jsoa+U5uUWB1Hb8s='
WHERE
key_id = 'e2059843e623265135651b92d2ec0856bf1720a1c74f550004a0a20d25c6ddf5'
AND (
token = 'p09doBOqmRuUN044iNjopzG1F58jsoa+U5uUWB1Hb8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)