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

Query time 0.00043