UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aJIHUQ5w+mES8+FAhOP8S8slq5/a/BdEbJygYX0qqDc=' 
WHERE 
  key_id = 'a8f205232bf311b7ce219fad6e9bbfcbbe4c4dce30ef40d4a20fe69664c8bfa0' 
  AND (
    token = 'aJIHUQ5w+mES8+FAhOP8S8slq5/a/BdEbJygYX0qqDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047