UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k0rg4zenOk6uOkZgn+gkcRRioIar1bwz9awag/leH5o='
WHERE
key_id = '575b36942ae51d7924574634eb2a175fb4d6ab6a48f37a5f16ce47075a01f142'
AND (
token = 'k0rg4zenOk6uOkZgn+gkcRRioIar1bwz9awag/leH5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)